﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace AMebooking.Models
{
    public class Calendar
    {
        public string type { get; set; }
        public DateTime starttime { get; set; }
        public DateTime endtime { get; set; }
        public string note { get; set; }
        public string smanid { get; set; }

        public Calendar() { }
        
        public override string ToString()
        {
            
            var objFormat = ""
               + "\"Description\": \"{0}\""
               + ", \"EndHour\": \"{1}\""
               + ", \"ShiftId\": \"{2}\""
               + ", \"SmanId\": \"{3}\""
               + ", \"StartHour\": \"{4}\""
               + ", \"Type\": \"{5}\""
               + ", \"WorkingDate\": \"{6}\""
               + ""
               ;
           
            var data = string.Format(objFormat, note, endtime.ToString("HH:mm"), 0, smanid, starttime.ToString("HH:mm"), type, starttime);
            return "{" + data + "}";
        }

    }
}
